package cn.ac.iie.controller;

import cn.ac.iie.entity.GirlProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author Fighter Created on 2018/10/8.
 */
//@Controller
//@ResponseBody
@RestController
@RequestMapping(value = "/hello")
public class HelloController {

    @Autowired
    private GirlProperties girl;

//    @Value("${content}")
//    private String content;

    @RequestMapping(value = {"/hello", "hi"}, method = RequestMethod.GET)
    public String say() {
        return girl.getCupSize();
    }

    @RequestMapping(value = {"/say/{id}"}, method = RequestMethod.GET)
    public String getPathId(@PathVariable("id") Integer id) {
        return "id: " + id;
    }

    @GetMapping(value = "say")
    public String getParamId(@RequestParam(value = "id", required = false, defaultValue = "0") Integer id) {
        return "id: " + id;
    }
}

